package com.example.pceb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.pceb.entity.HighSkillTrainingSubsidy;
import com.example.pceb.entity.StartupSocialInsuranceSubsidy;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface HighSkillTrainingSubsidyMapper extends BaseMapper<HighSkillTrainingSubsidy> {
    // 获取用户未提交的表单
    @Select("SELECT * FROM high_skill_training_subsidy WHERE username = #{username} AND status = '未提交' ORDER BY create_time DESC")
    List<HighSkillTrainingSubsidy> selectUnsubmittedByUsername(@Param("username") String username);

    // 获取用户已提交的表单
    @Select("SELECT * FROM high_skill_training_subsidy WHERE username = #{username} AND status != '未提交' ORDER BY create_time DESC")
    List<HighSkillTrainingSubsidy> selectSubmittedByUsername(@Param("username") String username);
}